<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <h1>404</h1>
      <h2>页面未找到</h2>
      <p>抱歉，您访问的页面不存在或已被移除</p>
      
      <div class="action-buttons">
        <router-link to="/" class="home-button">
          返回首页
        </router-link>
        <button @click="goBack" class="back-button">
          返回上一页
        </button>
      </div>
      
      <div class="path-info" v-if="$route.query.originalPath">
        <p>您尝试访问的路径: <code>{{ $route.query.originalPath }}</code></p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'NotFoundView',
  methods: {
    goBack() {
      if (window.history.length > 1) {
        this.$router.go(-1)
      } else {
        this.$router.push('/')
      }
    }
  }
}
</script>

<style scoped>
/* 保持你原有的样式不变 */
.not-found-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f8f9fa;
  padding: 20px;
}

.not-found-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.not-found-content h1 {
  font-size: 100px;
  margin: 0;
  color: #dc3545;
  line-height: 1;
}

.not-found-content h2 {
  font-size: 32px;
  margin: 20px 0 10px;
  color: #343a40;
}

.not-found-content p {
  font-size: 18px;
  color: #6c757d;
  margin-bottom: 30px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.home-button, .back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.home-button {
  background-color: #007bff;
  color: white;
  border: none;
}

.home-button:hover {
  background-color: #0069d9;
}

.back-button {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.back-button:hover {
  background-color: #e9ecef;
}

.path-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.path-info code {
  color: #dc3545;
  word-break: break-all;
}

@media (max-width: 576px) {
  .not-found-content {
    padding: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .not-found-content h1 {
    font-size: 80px;
  }
  
  .not-found-content h2 {
    font-size: 24px;
  }
}
</style>